<form nz-form [formGroup]="settingsForm">
  <nz-form-item
    class="setting-item actionable"
    (click)="outDirEditDialog.open()"
  >
    <nz-form-label class="setting-label">存放目录</nz-form-label>
    <nz-form-control
      [nzWarningTip]="syncFailedWarningTip"
      [nzValidateStatus]="syncStatus.outDir ? outDirControl : 'warning'"
    >
      <nz-form-text class="setting-value"
        >{{ outDirControl.value }}
      </nz-form-text>
      <app-outdir-edit-dialog
        #outDirEditDialog
        [value]="outDirControl.value"
        (confirm)="outDirControl.setValue($event)"
      ></app-outdir-edit-dialog>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item
    class="setting-item actionable"
    (click)="pathTemplateEditDialog.open()"
  >
    <nz-form-label class="setting-label">路径模板</nz-form-label>
    <nz-form-control
      [nzWarningTip]="syncFailedWarningTip"
      [nzValidateStatus]="
        syncStatus.pathTemplate ? pathTemplateControl : 'warning'
      "
    >
      <nz-form-text class="setting-value"
        >{{ pathTemplateControl.value }}
      </nz-form-text>
      <app-path-template-edit-dialog
        #pathTemplateEditDialog
        [value]="pathTemplateControl.value"
        (confirm)="pathTemplateControl.setValue($event)"
      >
      </app-path-template-edit-dialog>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item class="setting-item">
    <nz-form-label
      class="setting-label"
      nzNoColon
      [nzTooltipTitle]="filesizeLimitTip"
      >大小限制</nz-form-label
    >
    <ng-template #filesizeLimitTip>
      <p>
        自动分割文件以限制录播文件大小
        <br />
        格式：数字 + 单位(GB, MB, KB, B)
        <br />
        不自动分割文件设置为 <strong>0 B</strong>
        <br />
      </p>
    </ng-template>
    <nz-form-control
      class="setting-control select"
      [nzWarningTip]="syncFailedWarningTip"
      [nzValidateStatus]="
        syncStatus.filesizeLimit ? filesizeLimitControl : 'warning'
      "
    >
      <app-input-filesize formControlName="filesizeLimit"></app-input-filesize>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item class="setting-item">
    <nz-form-label
      class="setting-label"
      nzNoColon
      [nzTooltipTitle]="durationLimitTip"
      >时长限制</nz-form-label
    >
    <ng-template #durationLimitTip>
      <p>
        自动分割文件以限制录播文件时长
        <br />
        格式：HH:MM:SS
        <br />
        不自动分割文件设置为 <strong>00:00:00</strong>
        <br />
      </p>
    </ng-template>
    <nz-form-control
      class="setting-control select"
      [nzWarningTip]="syncFailedWarningTip"
      [nzValidateStatus]="
        syncStatus.durationLimit ? durationLimitControl : 'warning'
      "
    >
      <app-input-duration formControlName="durationLimit"></app-input-duration>
    </nz-form-control>
  </nz-form-item>
</form>
